import Vue from 'vue'
import VueI18n from 'vue-i18n'

import en from './lang/en'
import cn from './lang/cn'

import store from '@/store'
const defaultLang = store.state.i18n.lang || 'zhHans'

Vue.use(VueI18n)

const messages = {
  en: en,
  zhHans: cn
}

const i18n = new VueI18n({
  locale: defaultLang,
  // fallbackLocale: 'en',
  messages
})

export default i18n
